<!--#include file="lib/utf-8.asp"-->
<!--#include file="lib/connopen.asp"-->
<!--#include file="lib/asp-common-lib.asp"-->
<%
Set conn_res = Server.CreateObject("ADODB.CONNECTION")
db_res = "DRIVER=SQLite3 ODBC Driver;Database="&Server.MapPath("res3.db3")
conn_res.Open db_res

%>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<!--#include file="lib/plugins.asp"-->
<style type="text/css">
  .ui-datepicker table {
    border: 0;
  }
  .ui-autocomplete-loading { 
    background: white url('images/ui-anim_basic_16x16.gif') left center no-repeat; 
  }
  .ui-autocomplete,.ui-menu-item .ui-corner-all {
      border-radius: 0;
  }
  thead th{
    text-align:center;
    background:#e0e0e0;
  }
  tbody th[scope="row"],tbody th.sub{
    text-align:center;
  }
  input,select{
    border:1px solid #888888;
  }
  input:hover,input:active,select:hover,select:active{
    border:1px solid #aa6666
  }
  input[type=text]{
    padding:2px;
    margin:1px 0;
  }
  #pagebar{
    float:right;
  }
  #search_bar{
    border-width:1px 0;
  }
  #search_bar td{
    padding:1px;
    border-width:0;
  }
  #search_bar tr:hover td{
    background:#fff;
  }
  .bt_button{
    cursor: pointer;
    overflow: visible;
    width: auto;
    background: url("lib/yaml/screen/images/button_gray.png") repeat-x scroll left top #454545;
    border-color: #DDDDDD #444444 #444444 #DDDDDD;
    border-style: solid;
    border-width: 1px;
    color: #000000;
    padding: 5px 1em;
  }
  .bt_button:hover,.bt_button:active,.bt_button:focus{
    background: none repeat-x scroll left top #555555;
    border-color: #444444 #DDDDDD #DDDDDD #444444;
    color: #ffffff;
  }
  #page_go,#print_search,.bt_act{
    padding:0;
  }
  .chk{
    background-color:#d0d0d0;
  }
  #diaglog_print{
    display:none;
  }
  #lb_search{
    width:5em;
  }
  #bts_search{
    width:11.9em;
    text-align:right;
  }
  #adv_search{
    display:none;
  }
  #adv_search select{
    margin:1px 0;
  }
/* Tag cloud */
  
    #tags {  
      text-align:center; 
      padding:10px 0;  
      margin:5px 0;
      overflow:auto; 
    }  
    #tags ul { margin:0; padding:0; }  
    #tags ul li {  
      list-style-type:none; float:left; margin:-1px 10px; 
    }  
    #tags ul li a { text-decoration:none;  line-height:1.1em;}  
    #tags ul li a:hover { text-decoration:none; border:1px solid #aa6666}  
/* // Tag cloud */

/* select class */

    .sel{
      color:red;
    }
    .unsel{
      color:black;
    }
  
/* // select class */


</style>

<script type="text/javascript">
  $(function() {
    $.ajaxSetup ({
      cache: false, //关闭AJAX相应的缓存
      beforeSend:function() {
        $("#search_bar .ui-widget").addClass( "ui-autocomplete-loading" );
        $("#bt_search").attr("disabled",true);
      },
      complete:function() {
        $("#search_bar .ui-widget").removeClass( "ui-autocomplete-loading" );
        $("#bt_search").attr("disabled",false);
      }
    });

    $(".datepicker").datepicker();

    $("#print_search").live('click',function(){
      $( "#diaglog_print" ).dialog("open");
    });
    var p=1;
    function vi(p){
      $.get("research_main.asp?page="+p+"&"+$("#fm_search").serialize(),function(data){//用ajax的get方式提交
        $("#search_main").html(data);

        $("#pagebar a").click(function(e){//对分页栏中的a元素进行操作
          e.preventDefault();//阻止a的原先事件
          vi($(this).attr("id"));//根据获取的页码值调用显示页面函数
        });
        $("#page_go").click(function(e){//对分页栏中的input元素进行操作
          e.preventDefault();
          if (isNaN($("#page_val").val())||$.trim($("#page_val").val())==""){//判断输入的是否是数字
            alert("输入的页码错误，请输入正确页码！");
            $("#page_val").select();
            return false;//页码值不是数字则退出；
          }
          vi($("#page_val").val());
        });
        $(".res").cluetip({
          //sticky: true,
          //cluetipClass: 'rounded',
          showTitle: false,
          clickThrough: false,
          onShow: function(ct, c){
            $("#cluetip").css({"width":"auto","max-width":"400px"});
          }
        });
        
      });

    }
    
    $("#bt_search").click(function(){
      var start_time = new Date().getTime();
      vi(p);
      var end_time = new Date().getTime();
      $("#show_runtime").html(end_time-start_time);
    });
    $("#show_adv").click(function(){
      $("#adv_search").toggle();
    });
    
    //搜索条选择框筛选高亮显示
    /*
    //chrome 不支持 option的click事件
    $("#search_bar select option").click(function(){
      if($(this).index()>0){
        $(this).removeClass("unsel")
          .siblings().addClass("unsel")
          .parent().addClass("sel");
      }else{
        $(this).parent().removeClass("sel")
          .children().removeClass("unsel");
      }
    });
    */
    $("#search_bar input[type=reset]").click(function(){
      $("#search_bar select").removeClass("sel")
        .children().removeClass("unsel");
    });
    
    $("#search_bar select").change(function(){
      //console.log($(this).find("option:selected").index());
      $sel=$(this).find("option:selected");
      if($sel.index()>0){
        $sel.removeClass("unsel")
          .siblings().addClass("unsel")
          .parent().addClass("sel");
      }else{
        $sel.parent().removeClass("sel")
          .children().removeClass("unsel");
      }
    });
    //搜索条选择框筛选高亮显示    
  });
</script>
<!--#include file="lib/js-google-analytics.asp"-->
</head>


<%
' if not CheckPostFlag(session("aaPostFlag"),1,1) then call JumpErrorPage(2)
%>

<body>
<!--#include file="lib/header.asp"-->
<!--#include file="lib/nav.asp"-->
<div id="main">

<!--#include file="lib/col1.asp"-->
<!--#include file="lib/col2.asp"-->
  <div id="col3" role="main">
    <div id="col3_content" class="clearfix">
      <form id="fm_search" name="fm_search">
        <table id="search_bar" class="full">
          <tr>
            <td id="lb_search"><label for="tx_search">查询内容：</label></td>
            <td>
              <div>
                <input id="tx_search" name="tx_search" type="text" />
                <select id="accstype" name="accstype">
                  <option value="">接入类型</option>
                  <option value="1">LAN</option>
                  <option value="2">EOC</option>
                  <option value="3">CATV</option>
                </select>
                <select id="devctype" name="devctype">
                  <option value="">设备类型</option>
                  <%
                    Set rs = Server.CreateObject("ADODB.Recordset")
                    sql = "SELECT * from cDevcType"
                    rs.Open sql,conn_res,1,1
                    do while not rs.eof
                  %>
                  <option value="<%=rs("DevcTypeID")%>"><%=rs("DeviceType")%></option>
                  <%
                      rs.movenext
                    loop
                    rs.close
                    set rs=nothing
                  %>
                </select>
                <select id="project" name="project">
                  <option value="">小区</option>
                  <%
                    Set rs = Server.CreateObject("ADODB.Recordset")
                    sql = "SELECT * from tProject"
                    rs.Open sql,conn_res,1,1
                    do while not rs.eof
                  %>
                  <option value="<%=rs("ProjectID")%>"><%=rs("ProjectName")%></option>
                  <%
                      rs.movenext
                    loop
                    rs.close
                    set rs=nothing
                  %>
                </select>
                <select id="search_count" name="search_count">
                  <option value="100">最新100条</option>
                  <option value="0">全部</option>
                </select>
                <a id="show_adv" href="#">高级</a>
              </div>
              <div id="adv_search">
                安装日期
                <input name="ksrq" id="ksrq" class="datepicker" type="text" size="10" maxlength="10" />-<input name="jsrq" id="jsrq" class="datepicker" type="text" size="10" maxlength="10" />
                <select id="room" name="room">
                  <option value="">分前端</option>
                  <%
                    Set rs = Server.CreateObject("ADODB.Recordset")
                    sql = "SELECT * from tRoom"
                    rs.Open sql,conn_res,1,1
                    do while not rs.eof
                  %>
                  <option value="<%=rs("RoomID")%>"><%=rs("RoomName")%></option>
                  <%
                      rs.movenext
                    loop
                    rs.close
                    set rs=nothing
                  %>
                </select>
                <select id="roomtype" name="roomtype">
                  <option value="">机房类型</option>
                  <%
                    Set rs = Server.CreateObject("ADODB.Recordset")
                    sql = "SELECT * from cRoomType"
                    rs.Open sql,conn_res,1,1
                    do while not rs.eof
                  %>
                  <option value="<%=rs("RoomTypeID")%>"><%=rs("RoomType")%></option>
                  <%
                      rs.movenext
                    loop
                    rs.close
                    set rs=nothing
                  %>
                </select>
                <select id="devcmanu" name="devcmanu">
                  <option value="">设备厂商</option>
                  <%
                    Set rs = Server.CreateObject("ADODB.Recordset")
                    sql = "SELECT * from cDevcManu"
                    rs.Open sql,conn_res,1,1
                    do while not rs.eof
                  %>
                  <option value="<%=rs("DevcManuID")%>"><%=rs("DeviceManufacturer")%></option>
                  <%
                      rs.movenext
                    loop
                    rs.close
                    set rs=nothing
                  %>
                </select>

                <select id="empe" name="empe">
                  <option value="">安装人</option>
                  <%
                    Set rs = Server.CreateObject("ADODB.Recordset")
                    sql = "SELECT * from tEmpe"
                    rs.Open sql,conn_res,1,1
                    do while not rs.eof
                  %>
                  <option value="<%=rs("EmpeID")%>"><%=rs("FullName")%></option>
                  <%
                      rs.movenext
                    loop
                    rs.close
                    set rs=nothing
                  %>
                </select>
              </div>
            </td>
            <td id="bts_search">
              <div class="ui-widget">
              <input id="bt_search" class="bt_button" name="bt_submit" type="button" value="搜索" />
              <input class="bt_button" type="reset" value="重置" />
              </div>
            </td>
          </tr>
        </table>
      </form>
      <div id="search_main">
        <div id="tags"></div>
      </div>
    </div>
  </div>
</div>
<!--#include file="lib/footer.asp"-->
</body>
</html>
<%
conn_res.close
set conn_res=nothing

%>

<!--#include file="lib/connclose.asp"-->